home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AECUR100.ARJ / WCLRTOEO.C < prev    next >
C/C++ Source or Header  |  1990-03-08  |  831b  |  44 lines

  1. /*------------------------------------------------------------
  2.  * 
  3.  *  wclrtoeol.c
  4.  * 
  5.  *  copyright (c) 1987,88,89,90 J. Alan Eldridge
  6.  *
  7.  *  clear to end of line
  8.  *  clear to bottom of window
  9.  * 
  10.  *----------------------------------------------------------*/
  11.  
  12. #include "curses.h"
  13.  
  14. int
  15. wclrtoeol(win)
  16. WINDOW *win;
  17. {
  18.     int curx;
  19.     VIDCHR fillch;
  20.  
  21.     fillch.chr = ' ';
  22.     fillch.att = win->attrib;
  23.   
  24.     curx = win->curx;
  25.     memsetw(win->buf[win->cury] + curx, &fillch, win->maxx - curx + 1);
  26.     markwin(win);
  27.     wmove(win, win->cury, win->maxx);
  28.     markwin(win);
  29.     wmove(win, win->cury, curx);
  30.  
  31.     return OK;
  32. }
  33.  
  34. int
  35. wclrtobot(win)
  36. WINDOW *win;
  37. {
  38.     wclrtoeol(win);
  39.     if (win->maxy > win->cury)
  40.         _scroll(win, win->cury + 1, win->maxy, win->maxy);
  41.  
  42.     return OK;
  43. }
  44.